//
//  NetworkUtils.h
//  RTMKitDemo
//
//  Created by reyzhang on 2021/12/30.
//  AFNetwork 简单的二次封装

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

//请求超时
#define TIMEOUT 5.0f

typedef NS_ENUM(NSInteger,NetworkHTTPMethod) {
    HTTPMethodGET,
    HTTPMethodPOST,
};

@interface NetworkUtils : NSObject

typedef void(^RTMSuccessBlock)(NSDictionary * dic);
typedef void(^RTMFailureBlock)(NSError * error);

//key value 的形式
+ (void)get:(NSString *)url
 parameters:(NSDictionary *)parameters
     succes:(RTMSuccessBlock)success
    failure:(RTMFailureBlock)failure;

+ (void)post:(NSString *)url
  parameters:(NSDictionary *)parameters
      succes:(RTMSuccessBlock)success
     failure:(RTMFailureBlock)failure;


// json串中有body的形式
+ (void)getjson:(NSString *)url
    parameters:(NSDictionary *)parameters
    succes:(RTMSuccessBlock)success
    failure:(RTMFailureBlock)failure;


+ (void)postjson:(NSString *)url
      parameters:(NSDictionary *)parameters
          succes:(RTMSuccessBlock)success
         failure:(RTMFailureBlock)failure;

@end

NS_ASSUME_NONNULL_END
